<template>
  <div class="detail-logistics">
    <p>
      <span>{{list[0].text}}</span>
      <span>{{list[0].time}}</span>
    </p>
    <a  @click="orderonLogistics(orderData) " href="javascript:;">查看物流</a>
    <Teleport to='#model'>
    <OrderLogistics ref="refLogistics"></OrderLogistics>
    </Teleport>
  </div>
  
</template>
<script>
import {LogisticsInformationApi} from "@/api/order"
import OrderLogistics from "./order-logistics.vue"
import {uselogistics} from "../index.vue"
import {ref} from "vue"
export default {
  name: 'DetailLogistics',
  components:{
    OrderLogistics
  },
  props:{
    orderData:{
        type:Object,
        default:()=>{}
    },
  },
 async setup(props){
    const data=await LogisticsInformationApi(props.orderData.id)
    const list=ref(data.result.list)
    return {list,...uselogistics()}
  }
}
</script>
<style scoped lang="less">
.detail-logistics {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  background-color: #f5f5f5;
  margin: 30px 50px 0;
  > p {
    flex: 1;
    span {
      color: #999;
      &:first-child {
        margin-right: 30px;
      }
    }
  }
  > a {
    color: @xtxColor;
    text-align: center;
  }
}
</style>
